package com.mt.roll.wms.controller;

import com.mt.roll.core.base.BaseController;
import com.mt.roll.core.constants.CommonConstant;
import com.mt.roll.core.validator.groups.PageGroup;
import com.mt.roll.core.vo.PageVo;
import com.mt.roll.core.vo.R;
import com.mt.roll.wms.params.StorageBoxCircInfoHisQueryParam;
import com.mt.roll.wms.service.StorageBoxCircInfoHisService;
import com.mt.roll.wms.vo.StorageBoxCircInfoHisVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.groups.Default;

/**
 * @auther why
 * @date 2021/9/26 16:38
 */
@RestController
@RequestMapping(CommonConstant.API_MODULE_WMS + "storage/box/circ/info/his")
@Slf4j
@Api(value = "当前库存存储箱历史信息", tags = "当前库存存储箱历史信息", hidden = false)
public class StorageBoxCircInfoHisController extends BaseController {

    @Autowired
    private StorageBoxCircInfoHisService storageBoxCircInfoHisService;

    @PostMapping(value = "page/by/code")
    @ApiOperation(value = "通过存储箱号获取分页存储箱历史使用情况")
    private R<PageVo<StorageBoxCircInfoHisVo>> pageByCode(@Validated({PageGroup.class, Default.class}) @RequestBody StorageBoxCircInfoHisQueryParam storageBoxCircInfoHisQueryParam) {
        return storageBoxCircInfoHisService.pageByCode(storageBoxCircInfoHisQueryParam);
    }
}
